package com.itany.jdbc;

import java.sql.Connection;
import com.itany.util.JDBCUtil;

/**
 * @Author:石小俊
 * @Date:2022/11/14 15:56
 * @Version:1.0-SNAPSHOT
 * @Description:
 */
public class Test14 {

    public static void main(String[] args) {
        Connection conn = JDBCUtil.getConnection();
        Connection conn2 = JDBCUtil.getConnection();
        // 从线程池中释放
        JDBCUtil.close();
        Connection conn3 = JDBCUtil.getConnection();
        // true
        System.out.println(conn == conn2);
        // false
        System.out.println(conn3 == conn2);
    }

}
